<?php
class OrderSkipOrderCooldownAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * 跳过订单冷却时间
     *
     * @param int $userId
     * @param int $position
     * @param int $orderId
     * @param int $cliCost
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $position, $orderId, $cliCost, $reqTime)
    {
        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_NORMAL_TRAIN_ORDER)) {
            return $this->buildResponse(false);
        }
        return $this->buildResponse(
            OrderService::get()->payForSpeedUp($userId, $position, $orderId, $cliCost, $reqTime)
        );
    }
}